﻿<?php
include_once("../initial.php");
include_once("../dbdriver/adminUserWHandle.php");
include_once("../dbdriver/adminUserRHandle.php");
class adminUserLogic
{
    public function insert_user($array)
    {
        if(is_array($array)==false)
        {
            return false;
        }
        if(count($array)==0)
        {
            return false;
        }
        $whandle = new adminUserWHandle();
        return $whandle->insert_data($array);
    }
    public function get_user($array='', $orderby='', $limit='')
    {
        $rhandle = new adminUserRHandle();
        if($array == '')
        {
            return $rhandle->get_all_data($orderby,$limit);
        }
        else
        {
            return $rhandle->get_some_data($array, $orderby, $limit);
        }
    }
    public function get_user_num($array='')
    {
        $rhandle = new adminUserRHandle();
        return $rhandle->get_user_num($array);
    }
    public function update_user($array,$id)
    {
        $handle = new adminUserWHandle();
        return $handle->update_user($array,$id);
    }
    public function delete_user($id)
    {
        $handle = new adminUserWHandle();
        return $handle->delete_user($id);
    }
    public function delete_user_phy($id)
    {
        $handle = new adminUserWHandle();
        return $handle->delete_user_phy($id);
    }
}
?>
